Repository navigation
fix: include the store location in ObjectRef.full_path - #1648
Merged
dimitri-yatsenko merged 2 commits intoNov 10, 2026
Merged
dimitri-yatsenko merged 2 commits into
dimitri-yatsenko merged 2 commits into
Conversation
For s3, gcs and azure stores, full_path built <protocol>://<bucket>/<path> and left out the store's location, so it pointed to a path where the object is not when location is set. Use StorageBackend.get_url(), which builds the URL from the same _full_path the backend writes to. Fixes datajoint#1646
dimitri-yatsenko
previously approved these changes
Nov 2, 2026
dimitri-yatsenko
left a comment
Member
There was a problem hiding this comment.
- Correct.
StorageBackend.get_urlgoes through_full_path, which is where objects are written, sofs.exists(ref.full_path)now agrees with the backend. - A test with an s3
endpointpluslocation, and a trailing-slashlocation("proj/outbox/"), would pin the double-slash case if_full_pathdoesn't normalize it. - The
filebranch still builds its path by hand. It could also useget_url/_full_pathfor consistency, as a follow-up.
…tions The reviewer asked for a case that pins the trailing-slash location. It asserts that full_path equals what the backend builds for reads and writes, so it holds whether or not _full_path ever normalizes the slash.
Contributor
Author
|
Added the trailing-slash test in f5ec087. Left the |
dimitri-yatsenko
requested review from
MilagrosMarin,
lum-agilyti and
ttngu207
November 10, 2026 19:32
dimitri-yatsenko
approved these changes
Nov 10, 2026
dimitri-yatsenko
left a comment
Member
There was a problem hiding this comment.
Thanks @TheeCoderAhmed, this is ready.
- The s3 store with an endpoint and a location is pinned by a literal assertion in
test_full_path_includes_store_location, and gcs and azure are covered too. full_pathnow agrees with where the backend writes objects. With a trailing-slash location, both give.../proj/outbox//.... That is consistent with existing stores, so not normalizing it here is the right call.- CI passes on f5ec087: lint, and the MySQL 8.0 and 8.4 and Windows legs on Python 3.10, 3.14 and 3.15.
The remaining cases are in #1679: the file branch, and storage plugins registered through the datajoint.storage entry point, which still get the path without the location.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1646.
ObjectRef.full_pathleft out the storelocationfor s3, gcs and azure. Sofs.exists(ref.full_path)returnedFalsefor objects thatref.read()could open.It now uses
self._backend.get_url(self.path). Local paths are unchanged.Tests are in
tests/unit/test_objectref.py. No network needed. Thelocationcases fail on master.Thanks for the review.